package com.my.note.web.controller;

import com.my.note.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author lilun <a href="mailto:lil@chsi.com.cn">lilun</a>
 * @version $Id$ 2019年03月14 17:06
 */
@Controller
public class IndexController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = {"", "index"})
    public String index(Model model) {
        model.addAttribute("res", userService.getResourceByUrl("/love"));
        return "index";
    }

    @RequestMapping("tologin")
    public String toLogin() {
        return "login";
    }

    @RequestMapping(value = {"love", "love/index"})
    public String love() {
        return "love/index";
    }

}
